home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / NDK / NDK_3.5 / Documentation / Autodocs / amiga_lib.doc < prev    next >
Encoding:
Text File  |  1999-10-20  |  62.9 KB  |  2,121 lines

  1. TABLE OF CONTENTS
  2.  
  3. amiga.lib/ACrypt
  4. amiga.lib/AddTOF
  5. amiga.lib/afp
  6. amiga.lib/ArgArrayDone
  7. amiga.lib/ArgArrayInit
  8. amiga.lib/ArgInt
  9. amiga.lib/ArgString
  10. amiga.lib/arnd
  11. amiga.lib/BeginIO
  12. amiga.lib/CallHook
  13. amiga.lib/CallHookA
  14. amiga.lib/CheckRexxMsg
  15. amiga.lib/CoerceMethod
  16. amiga.lib/CoerceMethodA
  17. amiga.lib/CreateExtIO
  18. amiga.lib/CreatePort
  19. amiga.lib/CreateStdIO
  20. amiga.lib/CreateTask
  21. amiga.lib/CxCustom
  22. amiga.lib/CxDebug
  23. amiga.lib/CxFilter
  24. amiga.lib/CxSender
  25. amiga.lib/CxSignal
  26. amiga.lib/CxTranslate
  27. amiga.lib/dbf
  28. amiga.lib/DeleteExtIO
  29. amiga.lib/DeletePort
  30. amiga.lib/DeleteStdIO
  31. amiga.lib/DeleteTask
  32. amiga.lib/DoMethod
  33. amiga.lib/DoMethodA
  34. amiga.lib/DoSuperMethod
  35. amiga.lib/DoSuperMethodA
  36. amiga.lib/FastRand
  37. amiga.lib/fpa
  38. amiga.lib/FreeIEvents
  39. amiga.lib/GetRexxVar
  40. amiga.lib/HookEntry
  41. amiga.lib/HotKey
  42. amiga.lib/InvertString
  43. amiga.lib/LibAllocPooled
  44. amiga.lib/LibCreatePool
  45. amiga.lib/LibDeletePool
  46. amiga.lib/LibFreePooled
  47. amiga.lib/NewList
  48. amiga.lib/printf
  49. amiga.lib/RangeRand
  50. amiga.lib/RemTOF
  51. amiga.lib/SetRexxVar
  52. amiga.lib/SetSuperAttrs
  53. amiga.lib/sprintf
  54. amiga.lib/stdio
  55. amiga.lib/TimeDelay
  56. amiga.lib/ACrypt                                             amiga.lib/ACrypt
  57.  
  58.    NAME
  59.     ACrypt -- Encrypt a password
  60.  
  61.    SYNOPSIS
  62.     newpass = ACrypt( buffer, password, username )
  63.  
  64.     UBYTE *ACrypt( UBYTE *, UBYTE *, UBYTE *) ;
  65.  
  66.    FUNCTION
  67.     This function takes a buffer of at least 12 characters in length,
  68.     an unencrypted password and the user's name (as known to the host
  69.     system) and returns an encrypted password in the passed buffer.
  70.     This is a one-way encryption. Normally, the user's encrypted
  71.     password is stored in a file for future password comparison.
  72.  
  73.    INPUTS
  74.     buffer     - a pointer to a buffer at least 12 bytes in length.
  75.     password   - a pointer to an unencrypted password string.
  76.     username   - a pointer to the user's name.
  77.  
  78.    RESULT
  79.     newpass    - a pointer to the passed buffer if successful, NULL
  80.                  upon failure. The encrypted password placed in the
  81.                  buffer will be be eleven (11) characters in length
  82.                  and will be NULL-terminated.
  83.  
  84.    EXAMPLE
  85.  
  86.     UBYTE *pw, *getpassword() ;
  87.     UBYTE *user = "alf"
  88.     UBYTE *newpass ;
  89.     UBYTE buffer[16] ;         /* size >= 12 */
  90.  
  91.     pw = getpassword() ;   /* your own function */
  92.  
  93.     if((newpass = ACrypt(buffer, pw, user)) != NULL)
  94.     {
  95.         printf("pw = %s\n", newpass) ; /* newpass = &buffer[0] */
  96.     }
  97.     else
  98.     {
  99.         printf("ACrypt failed\n") ;
  100.     }
  101.  
  102. amiga.lib/AddTOF                                             amiga.lib/AddTOF
  103.  
  104.    NAME
  105.     AddTOF - add a task to the VBlank interrupt server chain.
  106.  
  107.    SYNOPSIS
  108.     AddTOF(i,p,a);
  109.  
  110.     VOID AddTOF(struct Isrvstr *, APTR, APTR);
  111.  
  112.    FUNCTION
  113.     Adds a task to the vertical-blanking interval interrupt server
  114.     chain. This prevents C programmers from needing to write an
  115.     assembly language stub to do this function.
  116.  
  117.    INPUTS
  118.     i - pointer to an initialized Isrvstr structure
  119.     p - pointer to the C-code routine that this server is to call each
  120.         time TOF happens
  121.     a - pointer to the first longword in an array of longwords that
  122.         is to be used as the arguments passed to your routine
  123.         pointed to by p.
  124.  
  125.    SEE ALSO
  126.     RemTOF(), <graphics/graphint.h>
  127.  
  128. amiga.lib/afp                                                   amiga.lib/afp
  129.  
  130.    NAME
  131.     afp - Convert ASCII string variable into fast floating point
  132.  
  133.    SYNOPSIS
  134.     ffp_value = afp(string);
  135.  
  136.     FUNCTION
  137.     Accepts the address of the ASCII string in C format that is
  138.     converted into an FFP floating point number.
  139.  
  140.     The string is expected in this Format:
  141.     {S}{digits}{'.'}{digits}{'E'}{S}{digits}
  142.     <*******MANTISSA*******><***EXPONENT***>
  143.  
  144.  
  145.     Syntax rules:
  146.     Both signs are optional and are '+' or '-'. The mantissa must be
  147.     present. The exponent need not be present. The mantissa may lead
  148.     with a decimal point. The mantissa need not have a decimal point.
  149.     Examples: All of these values represent the number fourty-two.
  150.              42        .042e3
  151.              42.      +.042e+03
  152.             +42.      0.000042e6
  153.         0000042.00     420000e-4
  154.                  420000.00e-0004
  155.  
  156.     Floating point range:
  157.     Fast floating point supports the value zero and non-zero values
  158.     within the following bounds -
  159.             18                   20
  160.      9.22337177 x 10   > +number >    5.42101070 x 10
  161.             18                   -20
  162.     -9.22337177 x 10   > -number > -2.71050535 x 10
  163.  
  164.     Precision:
  165.     This conversion results in a 24 bit precision with guaranteed
  166.     error less than or equal to one-half least significant bit.
  167.  
  168.     INPUTS
  169.     string - Pointer to the ASCII string to be converted.
  170.  
  171.  
  172.     OUTPUTS
  173.     string - points to the character which terminated the scan
  174.     equ - fast floating point equivalent
  175. amiga.lib/ArgArrayDone                                 amiga.lib/ArgArrayDone
  176.  
  177.    NAME
  178.     ArgArrayDone -- release the memory allocated by a previous call
  179.             to ArgArrayInit(). (V36)
  180.  
  181.    SYNOPSIS
  182.     ArgArrayDone();
  183.  
  184.     VOID ArgArrayDone(VOID);
  185.  
  186.    FUNCTION
  187.     This function frees memory and does cleanup required after a
  188.     call to ArgArrayInit(). Don't call this until you are done using
  189.     the ToolTypes argument strings.
  190.  
  191.    SEE ALSO
  192.     ArgArrayInit()
  193.  
  194. amiga.lib/ArgArrayInit                                 amiga.lib/ArgArrayInit
  195.  
  196.    NAME
  197.     ArgArrayInit -- allocate and initialize a tooltype array. (V36)
  198.  
  199.    SYNOPSIS
  200.     ttypes = ArgArrayInit(argc,argv);
  201.  
  202.     UBYTE **ArgArrayInit(LONG,UBYTE **);
  203.  
  204.    FUNCTION
  205.     This function returns a null-terminated array of strings
  206.     suitable for sending to icon.library/FindToolType(). This array will
  207.     be the ToolTypes array of the program's icon, if it was started from
  208.     Workbench. It will just be 'argv' if the program was started from
  209.     a shell.
  210.  
  211.     Pass ArgArrayInit() your startup arguments received by main().
  212.  
  213.     ArgArrayInit() requires that icon.library be open (even if the caller
  214.     was started from a shell, so that the function FindToolType() can be
  215.     used) and may call GetDiskObject(), so clean up is necessary when
  216.     the strings are no longer needed. The function ArgArrayDone() does
  217.     just that.
  218.  
  219.    INPUTS
  220.     argc - the number of arguments in argv, 0 when started from Workbench
  221.     argv - an array of pointers to the program's arguments, or the
  222.            Workbench startup message when started from WB.
  223.  
  224.    RESULTS
  225.     ttypes - the initialized argument array or NULL if it could not be
  226.              allocated
  227.  
  228.    EXAMPLE
  229.     Use of these routines facilitates the use of ToolTypes or command-
  230.     line arguments to control end-user parameters in Commodities
  231.     applications. For example, a filter used to trap a keystroke for
  232.     popping up a window might be created by something like this:
  233.  
  234.             char   *ttypes  = ArgArrayInit(argc, argv);
  235.             CxObj   *filter = UserFilter(ttypes, "POPWINDOW", "alt f1");
  236.  
  237.                ... with ...
  238.  
  239.                CxObj *UserFilter(char **tt, char *action_name,
  240.                   char *default_descr)
  241.         {
  242.         char *desc;
  243.  
  244.             desc = FindToolType(tt,action_name);
  245.  
  246.             return(CxFilter((ULONG)(desc? desc: default_descr)));
  247.         }
  248.  
  249.     In this way the user can assign "alt f2" to the action by
  250.     entering a tooltype in the program's icon of the form:
  251.  
  252.         POPWINDOW=alt f2
  253.  
  254.     or by starting the program from the CLI like so:
  255.  
  256.         myprogram "POPWINDOW=alt f2"
  257.  
  258.    NOTE
  259.     Your program must open icon.library and set up IconBase before calling
  260.     this routine. In addition IconBase must remain valid until after
  261.     ArgArrayDone() has been called!
  262.  
  263.    SEE ALSO
  264.     ArgArrayDone(), ArgString(), ArgInt(), icon.library/FindToolType()
  265.  
  266. amiga.lib/ArgInt                                             amiga.lib/ArgInt
  267.  
  268.    NAME
  269.     ArgInt -- return an integer value from a ToolTypes array. (V36)
  270.  
  271.    SYNOPSIS
  272.     value = ArgInt(tt,entry,defaultval)
  273.  
  274.     LONG ArgInt(UBYTE **,STRPTR,LONG);
  275.  
  276.    FUNCTION
  277.     This function looks in the ToolTypes array 'tt' returned
  278.     by ArgArrayInit() for 'entry' and returns the value associated
  279.     with it. 'tt' is in standard ToolTypes format such as:
  280.  
  281.         ENTRY=Value
  282.  
  283.     The Value string is passed to atoi() and the result is returned by
  284.     this function.
  285.  
  286.     If 'entry' is not found, the integer 'defaultval' is returned.
  287.  
  288.    INPUTS
  289.     tt - a ToolTypes array as returned by ArgArrayInit()
  290.     entry - the entry in the ToolTypes array to search for
  291.     defaultval - the value to return in case 'entry' is not found within
  292.              the ToolTypes array
  293.  
  294.    RESULTS
  295.     value - the value associated with 'entry', or defaultval if 'entry'
  296.         is not in the ToolTypes array
  297.  
  298.    NOTES
  299.     This function requires that dos.library V36 or higher be opened.
  300.  
  301.    SEE ALSO
  302.     ArgArrayInit()
  303.  
  304. amiga.lib/ArgString                                       amiga.lib/ArgString
  305.  
  306.    NAME
  307.     ArgString -- return a string pointer from a ToolTypes array. (V36)
  308.  
  309.    SYNOPSIS
  310.     string = ArgString(tt,entry,defaultstring)
  311.  
  312.     STRPTR ArgString(UBYTE **,STRPTR,STRPTR);
  313.  
  314.    FUNCTION
  315.     This function looks in the ToolTypes array 'tt' returned
  316.     by ArgArrayInit() for 'entry' and returns the value associated
  317.     with it. 'tt' is in standard ToolTypes format such as:
  318.  
  319.         ENTRY=Value
  320.  
  321.     This function returns a pointer to the Value string.
  322.  
  323.     If 'entry' is not found, 'defaultstring' is returned.
  324.  
  325.    INPUTS
  326.     tt - a ToolTypes array as returned by ArgArrayInit()
  327.     entry - the entry in the ToolTypes array to search for
  328.     defaultstring - the value to return in case 'entry' is not found within
  329.                 the ToolTypes array
  330.  
  331.    RESULTS
  332.     value - the value associated with 'entry', or defaultstring if 'entry'
  333.         is not in the ToolTypes array
  334.  
  335.    SEE ALSO
  336.     ArgArrayInit()
  337.  
  338. amiga.lib/arnd                                                 amiga.lib/arnd
  339.  
  340.   NAME
  341.     arnd - ASCII round of the provided floating point string
  342.  
  343.    SYNOPSIS
  344.     arnd(place, exp, &string[0]);
  345.  
  346.    FUNCTION
  347.     Accepts an ASCII string representing an FFP floating point
  348.     number, the binary representation of the exponent of said
  349.     floating point number and the number of places to round to.
  350.     A rounding process is initiated, either to the left or right
  351.     of the decimal place and the result placed back at the
  352.     input address defined by &string[0].
  353.  
  354.    INPUTS
  355.     place - integer representing number of decimal places to round to
  356.     exp - integer representing exponent value of the ASCII string
  357.     &string[0] - address where rounded ASCII string is to be placed
  358.              (16 bytes)
  359.  
  360.    RESULT
  361.     &string[0] - rounded ASCII string
  362.  
  363.    BUGS
  364.     None
  365. amiga.lib/BeginIO                                           amiga.lib/BeginIO
  366.  
  367.    NAME
  368.     BeginIO -- initiate asynchronous device I/O
  369.  
  370.    SYNOPSIS
  371.     BeginIO(ioReq)
  372.  
  373.     VOID BeginIO(struct IORequest *);
  374.  
  375.    FUNCTION
  376.     This function takes an IORequest, and passes it directly to the
  377.     "BeginIO" vector of the proper device.  This is equivalent to
  378.     SendIO(), except that io_Flags is not cleared. A good understanding
  379.     of Exec device I/O is required to properly use this function.
  380.  
  381.     This function does not wait for the I/O to complete.
  382.  
  383.    INPUTS
  384.     ioReq - an initialized and opened IORequest structure with the
  385.             io_Flags field set to a reasonable value (set to 0 if you do
  386.         not require io_Flags).
  387.  
  388.    SEE ALSO
  389.     exec.library/DoIO(), exec.library/SendIO(), exec.library/WaitIO()
  390.  
  391. amiga.lib/CallHook                                         amiga.lib/CallHook
  392.  
  393.    NAME
  394.     CallHook -- Invoke a hook given a message on the stack.
  395.  
  396.    SYNOPSIS
  397.     result = CallHook( hookPtr, obj, ... )
  398.  
  399.     ULONG CallHook( struct Hook *, Object *, ... );
  400.  
  401.    FUNCTION
  402.     Like CallHookA(), CallHook() invoke a hook on the supplied
  403.     hook-specific data (an "object") and a parameter packet ("message").
  404.     However, CallHook() allows you to build the message on your stack.
  405.  
  406.    INPUTS
  407.     hookPtr - A system-standard hook
  408.     obj - hook-specific data object
  409.     ... - The hook-specific message you wish to send.  The hook is
  410.         expecting a pointer to the message, so a pointer into your
  411.         stack will be sent.
  412.  
  413.    RESULT
  414.     result - a hook-specific result.
  415.  
  416.    NOTES
  417.     This function first appeared in the V37 release of amiga.lib.
  418.     However, it does not depend on any particular version of the OS,
  419.     and works fine even in V34.
  420.  
  421.    EXAMPLE
  422.     If your hook's message was
  423.  
  424.         struct myMessage
  425.         {
  426.         ULONG mm_FirstGuy;
  427.         ULONG mm_SecondGuy;
  428.         ULONG mm_ThirdGuy;
  429.         };
  430.  
  431.     You could write:
  432.  
  433.         result = CallHook( hook, obj, firstguy, secondguy, thirdguy );
  434.  
  435.     as a shorthand for:
  436.  
  437.         struct myMessage msg;
  438.  
  439.         msg.mm_FirstGuy = firstguy;
  440.         msg.mm_SecondGuy = secondguy;
  441.         msg.mm_ThirdGuy = thirdguy;
  442.  
  443.         result = CallHookA( hook, obj, &msg );
  444.  
  445.    SEE ALSO
  446.     CallHookA(), utility.library/CallHookPkt(), <utility/hooks.h>
  447.  
  448. amiga.lib/CallHookA                                       amiga.lib/CallHookA
  449.  
  450.    NAME
  451.     CallHookA -- Invoke a hook given a pointer to a message.
  452.  
  453.    SYNOPSIS
  454.     result = CallHookA( hookPtr, obj, message )
  455.  
  456.     ULONG CallHook( struct Hook *, Object *, APTR );
  457.  
  458.    FUNCTION
  459.     Invoke a hook on the supplied hook-specific data (an "object")
  460.     and a parameter packet ("message").  This function is equivalent
  461.     to utility.library/CallHookPkt().
  462.  
  463.    INPUTS
  464.     hookPtr - A system-standard hook
  465.     obj - hook-specific data object
  466.     message - The hook-specific message you wish to send
  467.  
  468.    RESULT
  469.     result - a hook-specific result.
  470.  
  471.    NOTES
  472.     This function first appeared in the V37 release of amiga.lib.
  473.     However, it does not depend on any particular version of the OS,
  474.     and works fine even in V34.
  475.  
  476.    SEE ALSO
  477.     CallHook(), utility.library/CallHookPkt(), <utility/hooks.h>
  478.  
  479. amiga.lib/CheckRexxMsg                                 amiga.lib/CheckRexxMsg
  480.  
  481.    NAME
  482.     CheckRexxMsg - Check if a RexxMsg is from ARexx
  483.  
  484.    SYNOPSIS
  485.     result = CheckRexxMsg(message)
  486.     D0                    A0
  487.  
  488.     BOOL CheckRexxMsg(struct RexxMsg *);
  489.  
  490.    FUNCTION
  491.     This function checks to make sure that the message is from ARexx
  492.     directly.  It is required when using the Rexx Variable Interface
  493.     routines (RVI) that the message be from ARexx.
  494.  
  495.     While this function is new in the V37 amiga.lib, it is safe to
  496.     call it in all versions of the operating system.  It is also
  497.     PURE code, thus usable in resident/pure executables.
  498.  
  499.    NOTE
  500.     This is a stub in amiga.lib.  It is only available via amiga.lib.
  501.     The stub has two labels.  One, _CheckRexxMsg, takes the arguments
  502.     from the stack.  The other, CheckRexxMsg, takes the arguments in
  503.     registers.
  504.  
  505.    EXAMPLE
  506.     if (CheckRexxMsg(rxmsg))
  507.     {
  508.         /* Message is one from ARexx */
  509.     }
  510.  
  511.    INPUTS
  512.     message        A pointer to the RexxMsg in question
  513.  
  514.    RESULTS
  515.     result        A boolean - TRUE if message is from ARexx.
  516.  
  517.    SEE ALSO
  518.     GetRexxVar(), SetRexxVar()
  519.  
  520. amiga.lib/CoerceMethod                                 amiga.lib/CoerceMethod
  521.  
  522.    NAME
  523.     CoerceMethod -- Perform method on coerced object.
  524.  
  525.    SYNOPSIS
  526.     result = CoerceMethod( cl, obj, MethodID, ... )
  527.  
  528.     ULONG CoerceMethod( struct IClass *, Object *, ULONG, ... );
  529.  
  530.    FUNCTION
  531.     Boopsi support function that invokes the supplied message
  532.     on the specified object, as though it were the specified
  533.     class.  Equivalent to CoerceMethodA(), but allows you to
  534.     build the message on the stack.
  535.  
  536.    INPUTS
  537.     cl - pointer to boopsi class to receive the message
  538.     obj - pointer to boopsi object
  539.     ... - method-specific message built on the stack
  540.  
  541.    RESULT
  542.     result - class and message-specific result.
  543.  
  544.    NOTES
  545.     This function first appears in the V37 release of amiga.lib.
  546.     While it intrinsically does not require any particular release
  547.     of the system software to operate, it is designed to work with
  548.     the boopsi subsystem of Intuition, which was only introduced
  549.     in V36.
  550.  
  551.    SEE ALSO
  552.     CoerceMethodA(), DoMethodA(), DoSuperMethodA(), <intuition/classusr.h>
  553.     ROM Kernel Manual boopsi section
  554.  
  555. amiga.lib/CoerceMethodA                               amiga.lib/CoerceMethodA
  556.  
  557.    NAME
  558.     CoerceMethodA -- Perform method on coerced object.
  559.  
  560.    SYNOPSIS
  561.     result = CoerceMethodA( cl, obj, msg )
  562.  
  563.     ULONG CoerceMethodA( struct IClass *, Object *, Msg );
  564.  
  565.    FUNCTION
  566.     Boopsi support function that invokes the supplied message
  567.     on the specified object, as though it were the specified
  568.     class.
  569.  
  570.    INPUTS
  571.     cl - pointer to boopsi class to receive the message
  572.     obj - pointer to boopsi object
  573.     msg - pointer to method-specific message to send
  574.  
  575.    RESULT
  576.     result - class and message-specific result.
  577.  
  578.    NOTES
  579.     This function first appears in the V37 release of amiga.lib.
  580.     While it intrinsically does not require any particular release
  581.     of the system software to operate, it is designed to work with
  582.     the boopsi subsystem of Intuition, which was only introduced
  583.     in V36.
  584.     Some early example code may refer to this function as CM().
  585.  
  586.    SEE ALSO
  587.     CoerceMethod(), DoMethodA(), DoSuperMethodA(), <intuition/classusr.h>
  588.     ROM Kernel Manual boopsi section
  589.  
  590. amiga.lib/CreateExtIO                                   amiga.lib/CreateExtIO
  591.  
  592.    NAME
  593.     CreateExtIO -- create an IORequest structure
  594.  
  595.    SYNOPSIS
  596.     ioReq = CreateExtIO(port,ioSize);
  597.  
  598.     struct IORequest *CreateExtIO(struct MsgPort *, ULONG);
  599.  
  600.    FUNCTION
  601.     Allocates memory for and initializes a new IO request block
  602.     of a user-specified number of bytes. The number of bytes
  603.     MUST be the size of a legal IORequest (or extended IORequest)
  604.     or very nasty things will happen.
  605.  
  606.    INPUTS
  607.     port - an already initialized message port to be used for this IO
  608.            request's reply port. If this is NULL this function fails.
  609.     ioSize - the size of the IO request to be created.
  610.  
  611.    RESULT
  612.     ioReq - a new IO Request block, or NULL if there was not enough memory
  613.  
  614.    EXAMPLE
  615.     if (ioReq = CreateExtIO(CreatePort(NULL,0),sizeof(struct IOExtTD)))
  616.  
  617.    SEE ALSO
  618.     DeleteExtIO(), CreatePort(), exec.library/CreateMsgPort()
  619.  
  620. amiga.lib/CreatePort                                     amiga.lib/CreatePort
  621.  
  622.    NAME
  623.     CreatePort - Allocate and initialize a new message port
  624.  
  625.    SYNOPSIS
  626.     port = CreatePort(name,pri)
  627.  
  628.     struct MsgPort *CreatePort(STRPTR,LONG);
  629.  
  630.    FUNCTION
  631.     Allocates and initializes a new message port. The message list
  632.     of the new port will be prepared for use (via NewList).  A signal
  633.     bit will be allocated, and the port will be set to signal your
  634.     task when a message arrives (PA_SIGNAL).
  635.  
  636.     You *must* use DeletePort() to delete ports created with
  637.     CreatePort()!
  638.  
  639.    INPUTS
  640.     name - public name of the port, or NULL if the port is not named.
  641.            The name string is not copied. Most ports do not need names,
  642.            see notes below on this.
  643.     pri  - Priority used for insertion into the public port list,
  644.            normally 0.
  645.  
  646.    RESULT
  647.     port - a new MsgPort structure ready for use, or NULL if the port
  648.            could not be created due to not enough memory or no available
  649.            signal bit.
  650.  
  651.    NOTE
  652.     In most cases, ports should not be named. Named ports are used for
  653.     rendez-vous between tasks. Everytime a named port needs to be located,
  654.     the list of all named ports must be traversed. The more named
  655.     ports there are, the longer this list traversal takes. Thus, unless
  656.     you really need to, do not name your ports, which will keep them off
  657.     of the named port list and improve system performance.
  658.  
  659.    BUGS
  660.     With versions of amiga.lib prior to V37.14, this function would
  661.     not fail even though it couldn't allocate a signal bit. The port
  662.     would be returned with no signal allocated.
  663.  
  664.    SEE ALSO
  665.     DeletePort(), exec.library/FindPort(), <exec/ports.h>,
  666.     exec.library/CreateMsgPort()
  667.  
  668. amiga.lib/CreateStdIO                                   amiga.lib/CreateStdIO
  669.  
  670.    NAME
  671.     CreateStdIO -- create an IOStdReq structure
  672.  
  673.    SYNOPSIS
  674.     ioReq = CreateStdIO(port);
  675.  
  676.     struct IOStdReq *CreateStdIO(struct MsgPort *)
  677.  
  678.    FUNCTION
  679.     Allocates memory for and initializes a new IOStdReq structure.
  680.  
  681.    INPUTS
  682.     port - an already initialized message port to be used for this IO
  683.            request's reply port. If this is NULL this function fails.
  684.  
  685.    RESULT
  686.     ioReq - a new IOStdReq structure, or NULL if there was not enough
  687.         memory
  688.  
  689.    SEE ALSO
  690.     DeleteStdIO(), CreateExtIO(), exec.library/CreateIORequest()
  691.  
  692. amiga.lib/CreateTask                                     amiga.lib/CreateTask
  693.  
  694.    NAME
  695.     CreateTask -- Create task with given name, priority, stacksize
  696.  
  697.    SYNOPSIS
  698.     task = CreateTask(name,pri,initPC,stackSize)
  699.  
  700.     struct Task *CreateTask(STRPTR,LONG,funcEntry,ULONG);
  701.  
  702.    FUNCTION
  703.     This function simplifies program creation of sub-tasks by
  704.     dynamically allocating and initializing required structures
  705.     and stack space, and adding the task to Exec's task list
  706.     with the given name and priority. A tc_MemEntry list is provided
  707.     so that all stack and structure memory allocated by CreateTask()
  708.     is automatically deallocated when the task is removed.
  709.  
  710.     An Exec task may not call dos.library functions or any function
  711.     which might cause the loading of a disk-resident library, device,
  712.     or file (since such functions are indirectly calls to dos.library).
  713.     Only AmigaDOS Processes may call AmigaDOS; see the
  714.     dos.library/CreateProc() or the dos.library/CreateNewProc()
  715.     functions for more information.
  716.  
  717.     If other tasks or processes will need to find this task by name,
  718.     provide a complex and unique name to avoid conflicts.
  719.  
  720.     If your compiler provides automatic insertion of stack-checking
  721.     code, you may need to disable this feature when compiling sub-task
  722.     code since the stack for the subtask is at a dynamically allocated
  723.     location.  If your compiler requires 68000 registers to contain
  724.     particular values for base relative addressing, you may need to
  725.     save these registers from your main process, and restore them
  726.     in your initial subtask code.
  727.  
  728.     The function entry initPC is generally provided as follows:
  729.  
  730.     In C:
  731.     extern void functionName();
  732.     char *tname = "unique name";
  733.     task = CreateTask(tname, 0L, functionName, 4000L);
  734.  
  735.     In assembler:
  736.         PEA    startLabel
  737.  
  738.    INPUTS
  739.     name - a null-terminated name string
  740.     pri - an Exec task priority between -128 and 127, normally 0
  741.     funcEntry - the address of the first executable instruction
  742.             of the subtask code
  743.     stackSize - size in bytes of stack for the subtask. Don't cut it
  744.             too close - system function stack usage may change.
  745.  
  746.    RESULT
  747.     task - a pointer to the newly created task, or NULL if there was not
  748.            enough memory.
  749.  
  750.    BUGS
  751.     Under exec.library V37 or beyond, the AddTask() function used
  752.     internally by CreateTask() can fail whereas it couldn't fail in
  753.     previous versions of Exec. Prior to amiga.lib V37.14, this function
  754.     did not check for failure of AddTask() and thus might return a
  755.     pointer to a task structure even though the task was not actually
  756.     added to the system.
  757.  
  758.     Prior to amiga.lib V40.20 low memory conditions could cause
  759.     CreateTask() to malfunction. The implementation checked whether the
  760.     initial AllocEntry() call would fail, but would use an inappropriate
  761.     test condition.
  762.  
  763.    SEE ALSO
  764.     DeleteTask(), exec/FindTask()
  765.  
  766. amiga.lib/CxCustom                                         amiga.lib/CxCustom
  767.  
  768.    NAME
  769.     CxCustom -- create a custom commodity object. (V36)
  770.  
  771.    SYNOPSIS
  772.     customObj = CxCustom(action,id);
  773.  
  774.     CxObj *CxCustom(LONG(*)(),LONG);
  775.  
  776.    FUNCTION
  777.     This function creates a custom commodity object. The action
  778.     of this object on receiving a commodity message is to call a
  779.     function of the application programmer's choice.
  780.  
  781.     The function provided ('action') will be passed a pointer to
  782.     the actual commodities message (in commodities private data
  783.     space), and will actually execute as part of the input handler
  784.     system task. Among other things, the value of 'id' can be
  785.     recovered from the message by using the function CxMsgID().
  786.  
  787.     The purpose of this function is two-fold. First, it allows
  788.     programmers to create Commodities Exchange objects with
  789.     functionality that was not imagined or chosen for inclusion
  790.     by the designers. Secondly, this is the only way to act
  791.     synchronously with Commodities.
  792.  
  793.     This function is a C-language macro for CreateCxObj(), defined
  794.     in <libraries/commodities.h>.
  795.  
  796.    INPUTS
  797.     action - a function to call whenever a message reaches the object
  798.     id - a message id to assign to the object
  799.  
  800.    RESULTS
  801.     customObj - a pointer to the new custom object, or NULL if it could
  802.             not be created.
  803.  
  804.   SEE ALSO
  805.     commodities.library/CreateCxObj(), commodities.library/CxMsgID()
  806.  
  807. amiga.lib/CxDebug                                           amiga.lib/CxDebug
  808.  
  809.    NAME
  810.     CxDebug -- create a commodity debug object. (V36)
  811.  
  812.    SYNOPSIS
  813.     debugObj = CxDebug(id);
  814.  
  815.     CxObj *CxDebug(LONG);
  816.  
  817.    FUNCTION
  818.     This function creates a Commodities debug object. The action of this
  819.     object on receiving a Commodities message is to print out information
  820.     about the Commodities message through the serial port (using the
  821.     kprintf() routine). The value of 'id' will also be displayed.
  822.  
  823.     Note that this is a synchronous occurrence (the printing is done by
  824.     the input device task). If screen or file output is desired, using a
  825.     sender object instead of a debug object is necessary, since such
  826.     output is best done by your application process.
  827.  
  828.     This function is a C-language macro for CreateCxObj(), defined
  829.     in <libraries/commodities.h>.
  830.  
  831.    INPUTS
  832.     id - the id to assign to the debug object, this value is output
  833.          whenever the debug object sends data to the serial port.
  834.  
  835.    RESULTS
  836.     debugObj - a pointer to the debug object, or NULL if it could
  837.            not be created.
  838.  
  839.    SEE ALSO
  840.     commodities.library/CreateCxObj(), CxSender(), debug.lib/kprintf()
  841.  
  842. amiga.lib/CxFilter                                         amiga.lib/CxFilter
  843.  
  844.    NAME
  845.     CxFilter -- create a commodity filter object. (V36)
  846.  
  847.    SYNOPSIS
  848.     filterObj = CxFilter(description);
  849.  
  850.     CxObj *CxFilter(STRPTR)
  851.  
  852.    FUNCTION
  853.     Creates an input event filter object that matches the
  854.     'description' string. If 'description' is NULL, the filter will not
  855.     match any messages.
  856.  
  857.     A filter may be modified by the functions SetFilter(), using
  858.     a description string, and SetFilterIX(), which takes a
  859.     binary Input Expression as a parameter.
  860.  
  861.     This function is a C-language macro for CreateCxObj(), defined
  862.     in <libraries/commodities.h>.
  863.  
  864.    INPUTS
  865.     description - the description string in the same format as strings
  866.               expected by commodities.library/SetFilter()
  867.  
  868.    RESULTS
  869.     filterObj - a pointer to the filter object, or NULL if there
  870.             was not enough memory. If there is a problem in the
  871.             description string, the internal error code of the filter
  872.             object will be set to so indicate. This error code may be
  873.             interrogated using the function CxObjError().
  874.  
  875.    SEE ALSO
  876.     commodities.library/CreateCxObj(), commodities.library/SetFilter(),
  877.     commodities.library/SetFilterIX(), commodities.library/CxObjError()
  878.  
  879. amiga.lib/CxSender                                         amiga.lib/CxSender
  880.  
  881.    NAME
  882.     CxSender -- create a commodity sender object. (V36)
  883.  
  884.    SYNOPSIS
  885.     senderObj = CxSender(port,id)
  886.  
  887.     CxObj *CxSender(struct MsgPort *,LONG);
  888.  
  889.    FUNCTION
  890.     This function creates a Commodities sender object. The action
  891.     of this object on receiving a Commodities message is to copy the
  892.     Commodities message into a standard Exec Message, to put the value
  893.     'id' in the message as well, and to send the message off to the
  894.     message port 'port'.
  895.  
  896.     The value 'id' is used so that an application can monitor
  897.     messages from several senders at a single port. It can be retrieved
  898.     from the Exec message by using the function CxMsgID(). The value can
  899.     be a simple integer ID, or a pointer to some application data
  900.     structure.
  901.  
  902.     Note that Exec messages sent by sender objects arrive
  903.     asynchronously at the destination port. Do not assume anything about
  904.     the status of the Commodities message which was copied into the Exec
  905.     message you received.
  906.  
  907.     All Exec messages sent to your ports must be replied. Messages may be
  908.     replied after the sender object has been deleted.
  909.  
  910.     This function is a C-language macro for CreateCxObj(), defined
  911.     in <libraries/commodities.h>.
  912.  
  913.    INPUTS
  914.     port - the port for the sender to send messages to
  915.     id - the id of the messages sent by the sender
  916.  
  917.    RESULTS
  918.     senderObj - a pointer to the sender object, or NULL if it could
  919.             not be created.
  920.  
  921.    SEE ALSO
  922.     commodities.library/CreateCxObj(), commodities.library/CxMsgID(),
  923.     exec.library/PutMsg(), exec.library/ReplyMsg()
  924.  
  925. amiga.lib/CxSignal                                         amiga.lib/CxSignal
  926.  
  927.    NAME
  928.     CxSignal -- create a commodity signaller object. (V36)
  929.  
  930.    SYNOPSIS
  931.     signalerObj = CxSignal(task,signal);
  932.  
  933.     CxObj *CxSignal(struct Task *,LONG);
  934.  
  935.    FUNCTION
  936.     This function creates a Commodities signal object. The action
  937.     of this object on receiving a Commodities message is to
  938.     send the 'signal' to the 'task'. The caller is responsible
  939.     for allocating the signal and determining the proper task ID.
  940.  
  941.     Note that 'signal' is the signal value as returned by AllocSignal(),
  942.     not the mask made from that value.
  943.  
  944.     This function is a C-language macro for CreateCxObj(), defined
  945.     in <libraries/commodities.h>.
  946.  
  947.    INPUTS
  948.     task - the task for the signaller to signal
  949.     signal - the signal bit number for the signaller to send
  950.  
  951.    RESULTS
  952.     signallerObj - a pointer to the signaller object, or NULL if it could
  953.                not be created.
  954.  
  955.    SEE ALSO
  956.     commodities.library/CreateCxObj(), exec.library/FindTask()
  957.     exec.library/Signal(), exec.library/AllocSignal(),
  958.  
  959. amiga.lib/CxTranslate                                   amiga.lib/CxTranslate
  960.  
  961.    NAME
  962.     CxTranslate -- create a commodity translator object. (V36)
  963.  
  964.    SYNOPSIS
  965.     translatorObj = CxTranslate(ie);
  966.  
  967.     CxObj *CxTranslate(struct InputEvent *);
  968.  
  969.    FUNCTION
  970.     This function creates a Commodities 'translator' object.
  971.     The action of this object on receiving a Commodities message is to
  972.     replace that message in the commodities network with a chain of
  973.     Commodities input messages.
  974.  
  975.     There is one new Commodities input message generated for each input
  976.     event in the linked list starting at 'ie' (and NULL terminated). The
  977.     routing information of the new input messages is copied from the input
  978.     message they replace.
  979.  
  980.     The linked list of input events associated with a translator object
  981.     can be changed using the SetTranslate() function.
  982.  
  983.     If 'ie' is NULL, the null translation occurs: that is, the original
  984.     commodities input message is disposed, and no others are created to
  985.     take its place.
  986.  
  987.     This function is a C-language macro for CreateCxObj(), defined
  988.     in <libraries/commodities.h>.
  989.  
  990.    INPUTS
  991.     ie - the input event list used as replacement by the translator
  992.  
  993.    RESULTS
  994.     translatorObj - a pointer to the translator object, or NULL if it could
  995.                 not be created.
  996.  
  997.    SEE ALSO
  998.     commodities.library/CreateCxObj(), commodities.library/SetTranslate()
  999.  
  1000. amiga.lib/dbf                                                   amiga.lib/dbf
  1001.  
  1002.    NAME
  1003.     dbf - convert FFP dual-binary number to FFP format
  1004.  
  1005.    SYNOPSIS
  1006.     fnum = dbf(exp, mant);
  1007.  
  1008.    FUNCTION
  1009.     Accepts a dual-binary format (described below) floating point
  1010.     number and converts it to an FFP format floating point number.
  1011.     The dual-binary format is defined as:
  1012.  
  1013.         exp bit  16    = sign (0=>positive, 1=>negative)
  1014.         exp bits 15-0    = binary integer representing the base
  1015.                       ten (10) exponent
  1016.         man        = binary integer mantissa
  1017.  
  1018.    INPUTS
  1019.     exp - binary integer representing sign and exponent
  1020.     mant - binary integer representing the mantissa
  1021.  
  1022.    RESULT
  1023.     fnum - converted FFP floating point format number
  1024.  
  1025.    BUGS
  1026.     None
  1027. amiga.lib/DeleteExtIO                                   amiga.lib/DeleteExtIO
  1028.  
  1029.    NAME
  1030.     DeleteExtIO - return memory allocated for extended IO request
  1031.  
  1032.    SYNOPSIS
  1033.     DeleteExtIO(ioReq);
  1034.  
  1035.     VOID DeleteExtIO(struct IORequest *);
  1036.  
  1037.    FUNCTION
  1038.     Frees up an IO request as allocated by CreateExtIO().
  1039.  
  1040.    INPUTS
  1041.     ioReq - the IORequest block to be freed, or NULL.
  1042.  
  1043.    SEE ALSO
  1044.     CreateExtIO()
  1045.  
  1046. amiga.lib/DeletePort                                     amiga.lib/DeletePort
  1047.  
  1048.    NAME
  1049.     DeletePort - free a message port created by CreatePort()
  1050.  
  1051.    SYNOPSIS
  1052.     DeletePort(port)
  1053.  
  1054.     VOID DeletePort(struct MsgPort *);
  1055.  
  1056.    FUNCTION
  1057.     Frees a message port created by CreatePort. All messages that
  1058.     may have been attached to this port must have already been
  1059.     replied before this function is called.
  1060.  
  1061.    INPUTS
  1062.     port - message port to delete
  1063.  
  1064.    SEE ALSO
  1065.     CreatePort()
  1066.  
  1067. amiga.lib/DeleteStdIO                                   amiga.lib/DeleteStdIO
  1068.  
  1069.    NAME
  1070.     DeleteStdIO - return memory allocated for IOStdReq
  1071.  
  1072.    SYNOPSIS
  1073.     DeleteStdIO(ioReq);
  1074.  
  1075.     VOID DeleteStdIO(struct IOStdReq *);
  1076.  
  1077.    FUNCTION
  1078.     Frees up an IOStdReq as allocated by CreateStdIO().
  1079.  
  1080.    INPUTS
  1081.     ioReq - the IORequest block to be freed, or NULL.
  1082.  
  1083.    SEE ALSO
  1084.     CreateStdIO(), DeleteExtIO(), exec.library/CreateIORequest()
  1085.  
  1086. amiga.lib/DeleteTask                                     amiga.lib/DeleteTask
  1087.  
  1088.    NAME
  1089.     DeleteTask -- delete a task created with CreateTask()
  1090.  
  1091.    SYNOPSIS
  1092.     DeleteTask(task)
  1093.  
  1094.     VOID DeleteTask(struct Task *);
  1095.  
  1096.    FUNCTION
  1097.     This function simply calls exec.library/RemTask(), deleting a task
  1098.     from the Exec task lists and automatically freeing any stack and
  1099.     structure memory allocated for it by CreateTask().
  1100.  
  1101.     Before deleting a task, you must first make sure that the task is
  1102.     not currently executing any system code which might try to signal
  1103.     the task after it is gone.
  1104.  
  1105.     This can be accomplished by stopping all sources that might reference
  1106.     the doomed task, then causing the subtask to execute a Wait(0L).
  1107.     Another option is to have the task call DeleteTask()/RemTask() on
  1108.     itself.
  1109.  
  1110.    INPUTS
  1111.     task - task to remove from the system
  1112.  
  1113.    NOTE
  1114.     This function simply calls exec.library/RemTask(), so you can call
  1115.     RemTask() directly instead of calling this function.
  1116.  
  1117.    SEE ALSO
  1118.     CreateTask(), exec.library/RemTask()
  1119.  
  1120. amiga.lib/DoMethod                                         amiga.lib/DoMethod
  1121.  
  1122.    NAME
  1123.     DoMethod -- Perform method on object.
  1124.  
  1125.    SYNOPSIS
  1126.     result = DoMethod( obj, MethodID, ... )
  1127.  
  1128.     ULONG DoMethod( Object *, ULONG, ... );
  1129.  
  1130.    FUNCTION
  1131.     Boopsi support function that invokes the supplied message
  1132.     on the specified object.  The message is invoked on the
  1133.     object's true class.  Equivalent to DoMethodA(), but allows
  1134.     you to build the message on the stack.
  1135.  
  1136.    INPUTS
  1137.     obj - pointer to boopsi object
  1138.     MethodID - which method to send (see <intuition/classusr.h>)
  1139.     ... - method-specific message built on the stack
  1140.  
  1141.    RESULT
  1142.     result - specific to the message and the object's class.
  1143.  
  1144.    NOTES
  1145.     This function first appears in the V37 release of amiga.lib.
  1146.     While it intrinsically does not require any particular release
  1147.     of the system software to operate, it is designed to work with
  1148.     the boopsi subsystem of Intuition, which was only introduced
  1149.     in V36.
  1150.  
  1151.    SEE ALSO
  1152.     DoMethodA(), CoerceMethodA(), DoSuperMethodA(), <intuition/classusr.h>
  1153.     ROM Kernel Manual boopsi section
  1154.  
  1155. amiga.lib/DoMethodA                                       amiga.lib/DoMethodA
  1156.  
  1157.    NAME
  1158.     DoMethodA -- Perform method on object.
  1159.  
  1160.    SYNOPSIS
  1161.     result = DoMethodA( obj, msg )
  1162.  
  1163.     ULONG DoMethodA( Object *, Msg );
  1164.  
  1165.    FUNCTION
  1166.     Boopsi support function that invokes the supplied message
  1167.     on the specified object.  The message is invoked on the
  1168.     object's true class.
  1169.  
  1170.    INPUTS
  1171.     obj - pointer to boopsi object
  1172.     msg - pointer to method-specific message to send
  1173.  
  1174.    RESULT
  1175.     result - specific to the message and the object's class.
  1176.  
  1177.    NOTES
  1178.     This function first appears in the V37 release of amiga.lib.
  1179.     While it intrinsically does not require any particular release
  1180.     of the system software to operate, it is designed to work with
  1181.     the boopsi subsystem of Intuition, which was only introduced
  1182.     in V36.
  1183.     Some early example code may refer to this function as DM().
  1184.  
  1185.    SEE ALSO
  1186.     DoMethod(), CoerceMethodA(), DoSuperMethodA(), <intuition/classusr.h>
  1187.     ROM Kernel Manual boopsi section
  1188.  
  1189. amiga.lib/DoSuperMethod                               amiga.lib/DoSuperMethod
  1190.  
  1191.    NAME
  1192.     DoSuperMethod -- Perform method on object coerced to superclass.
  1193.  
  1194.    SYNOPSIS
  1195.     result = DoSuperMethod( cl, obj, MethodID, ... )
  1196.  
  1197.     ULONG DoSuperMethod( struct IClass *, Object *, ULONG, ... );
  1198.  
  1199.    FUNCTION
  1200.     Boopsi support function that invokes the supplied message
  1201.     on the specified object, as though it were the superclass
  1202.     of the specified class.  Equivalent to DoSuperMethodA(),
  1203.     but allows you to build the message on the stack.
  1204.  
  1205.    INPUTS
  1206.     cl - pointer to boopsi class whose superclass is to
  1207.         receive the message
  1208.     obj - pointer to boopsi object
  1209.     ... - method-specific message built on the stack
  1210.  
  1211.    RESULT
  1212.     result - class and message-specific result.
  1213.  
  1214.    NOTES
  1215.     This function first appears in the V37 release of amiga.lib.
  1216.     While it intrinsically does not require any particular release
  1217.     of the system software to operate, it is designed to work with
  1218.     the boopsi subsystem of Intuition, which was only introduced
  1219.     in V36.
  1220.  
  1221.    SEE ALSO
  1222.     CoerceMethodA(), DoMethodA(), DoSuperMethodA(), <intuition/classusr.h>
  1223.     ROM Kernel Manual boopsi section
  1224.  
  1225. amiga.lib/DoSuperMethodA                             amiga.lib/DoSuperMethodA
  1226.  
  1227.    NAME
  1228.     DoSuperMethodA -- Perform method on object coerced to superclass.
  1229.  
  1230.    SYNOPSIS
  1231.     result = DoSuperMethodA( cl, obj, msg )
  1232.  
  1233.     ULONG DoSuperMethodA( struct IClass *, Object *, Msg );
  1234.  
  1235.    FUNCTION
  1236.     Boopsi support function that invokes the supplied message
  1237.     on the specified object, as though it were the superclass
  1238.     of the specified class.
  1239.  
  1240.    INPUTS
  1241.     cl - pointer to boopsi class whose superclass is to
  1242.         receive the message
  1243.     obj - pointer to boopsi object
  1244.     msg - pointer to method-specific message to send
  1245.  
  1246.    RESULT
  1247.     result - class and message-specific result.
  1248.  
  1249.    NOTES
  1250.     This function first appears in the V37 release of amiga.lib.
  1251.     While it intrinsically does not require any particular release
  1252.     of the system software to operate, it is designed to work with
  1253.     the boopsi subsystem of Intuition, which was only introduced
  1254.     in V36.
  1255.     Some early example code may refer to this function as DSM().
  1256.  
  1257.    SEE ALSO
  1258.     CoerceMethodA(), DoMethodA(), DoSuperMethod(), <intuition/classusr.h>
  1259.     ROM Kernel Manual boopsi section
  1260.  
  1261. amiga.lib/FastRand                                         amiga.lib/FastRand
  1262.  
  1263.    NAME
  1264.     FastRand - quickly generate a somewhat random integer
  1265.  
  1266.    SYNOPSIS
  1267.     number = FastRand(seed);
  1268.  
  1269.     ULONG FastRand(ULONG);
  1270.  
  1271.    FUNCTION
  1272.     Seed value is taken from stack, shifted left one position,
  1273.     exclusive-or'ed with hex value $1D872B41 and returned.
  1274.  
  1275.    INPUTS
  1276.     seed - a 32-bit integer
  1277.  
  1278.    RESULT
  1279.     number - new random seed, a 32-bit value
  1280.  
  1281.    SEE ALSO
  1282.     RangeRand()
  1283.  
  1284. amiga.lib/fpa                                                   amiga.lib/fpa
  1285.  
  1286.    NAME
  1287.     fpa - convert fast floating point into ASCII string equivalent
  1288.  
  1289.    SYNOPSIS
  1290.     exp = fpa(fnum, &string[0]);
  1291.  
  1292.    FUNCTION
  1293.     Accepts an FFP number and the address of the ASCII string where it's
  1294.     converted output is to be stored.  The number is converted to a NULL
  1295.     terminated ASCII string in and stored at the address provided.
  1296.     Additionally, the base ten (10) exponent in binary form is returned.
  1297.  
  1298.    INPUTS
  1299.     fnum       - Motorola Fast Floating Point number
  1300.     &string[0] - address for output of converted ASCII character string
  1301.              (16 bytes)
  1302.  
  1303.    RESULT
  1304.     &string[0] - converted ASCII character string
  1305.     exp       - integer exponent value in binary form
  1306.  
  1307.    BUGS
  1308.     None
  1309. amiga.lib/FreeIEvents                                   amiga.lib/FreeIEvents
  1310.  
  1311.    NAME
  1312.     FreeIEvents -- free a chain of input events allocated by
  1313.                InvertString(). (V36)
  1314.  
  1315.    SYNOPSIS
  1316.     FreeIEvents(events)
  1317.  
  1318.     VOID FreeIEvents(struct InputEvent *);
  1319.  
  1320.    FUNCTION
  1321.     This function frees a linked list of input events as obtained from
  1322.     InvertString().
  1323.  
  1324.    INPUTS
  1325.        events - the list of input events to free, may be NULL.
  1326.  
  1327.    SEE ALSO
  1328.     InvertString()
  1329.  
  1330. amiga.lib/GetRexxVar                                     amiga.lib/GetRexxVar
  1331.  
  1332.    NAME
  1333.     GetRexxVar - Gets the value of a variable from a running ARexx program
  1334.  
  1335.    SYNOPSIS
  1336.     error = GetRexxVar(message,varname,bufpointer)
  1337.     D0,A1              A0      A1      (C-only)
  1338.  
  1339.     LONG GetRexxVar(struct RexxMsg *,char *,char **);
  1340.  
  1341.    FUNCTION
  1342.     This function will attempt to extract the value of the symbol
  1343.     varname from the ARexx script that sent the message.  When called
  1344.     from C, a pointer to the extracted value will be placed in the
  1345.     pointer pointed to by bufpointer.  (*bufpointer will be the pointer
  1346.     to the value)
  1347.  
  1348.     When called from assembly, the pointer will be returned in A1.
  1349.  
  1350.     The value string returned *MUST* *NOT* be modified.
  1351.  
  1352.     While this function is new in the V37 amiga.lib, it is safe to
  1353.     call it in all versions of the operating system.  It is also
  1354.     PURE code, thus usable in resident/pure executables.
  1355.  
  1356.    NOTE
  1357.     This is a stub in amiga.lib.  It is only available via amiga.lib.
  1358.     The stub has two labels.  One, _GetRexxVar, takes the arguments
  1359.     from the stack.  The other, GetRexxVar, takes the arguments in
  1360.     registers.
  1361.  
  1362.     This routine does a CheckRexxMsg() on the message.
  1363.  
  1364.    EXAMPLE
  1365.  
  1366.     char    *value;
  1367.  
  1368.     /* Message is one from ARexx */
  1369.     if (!GetRexxVar(rxmsg,"TheVar",&value))
  1370.     {
  1371.         /* The value was gotten and now is pointed to by value */
  1372.         printf("Value of TheVar is %s\n",value);
  1373.     }
  1374.  
  1375.    INPUTS
  1376.     message        A message gotten from an ARexx script
  1377.     varname        The name of the variable to extract
  1378.     bufpointer    (For C only) A pointer to a string pointer.
  1379.  
  1380.    RESULTS
  1381.     error        0 for success, otherwise an error code.
  1382.             (Other codes may exists, these are documented)
  1383.             3  == Insufficient Storage
  1384.             9  == String too long
  1385.             10 == invalid message
  1386.  
  1387.     A1        (Assembly only)  Pointer to the string.
  1388.  
  1389.    SEE ALSO
  1390.     SetRexxVar(), CheckRexxMsg()
  1391.  
  1392. amiga.lib/HookEntry                                       amiga.lib/HookEntry
  1393.  
  1394.    NAME
  1395.     HookEntry -- Assembler to HLL conversion stub for hook entry.
  1396.  
  1397.    SYNOPSIS
  1398.     result = HookEntry( struct Hook *, Object *, APTR )
  1399.     D0                  A0             A2        A1
  1400.  
  1401.    FUNCTION
  1402.     By definition, a standard hook entry-point must receive the
  1403.     hook in A0, the object in A2, and the message in A1.  If your
  1404.     hook entry-point is written in a high-level language and is
  1405.     expecting its parameters on the stack, then HookEntry() will
  1406.     put the three parameters on the stack and invoke the function
  1407.     stored in the hook h_SubEntry field.
  1408.  
  1409.     This function is only useful to hook implementers, and is
  1410.     never called from C.
  1411.  
  1412.    INPUTS
  1413.     hook - pointer to hook being invoked
  1414.     object - pointer to hook-specific data
  1415.     msg - pointer to hook-specific message
  1416.  
  1417.    RESULT
  1418.     result - a hook-specific result.
  1419.  
  1420.    NOTES
  1421.     This function first appeared in the V37 release of amiga.lib.
  1422.     However, it does not depend on any particular version of the OS,
  1423.     and works fine even in V34.
  1424.  
  1425.    EXAMPLE
  1426.     If your hook dispatcher is this:
  1427.  
  1428.     dispatch( struct Hook *hookPtr, Object *obj, APTR msg )
  1429.     {
  1430.         ...
  1431.     }
  1432.  
  1433.     Then when you initialize your hook, you would say:
  1434.  
  1435.     myhook.h_Entry = HookEntry;    /* amiga.lib stub */
  1436.     myhook.h_SubEntry = dispatch;    /* HLL entry */
  1437.  
  1438.    SEE ALSO
  1439.     CallHook(), CallHookA(), <utility/hooks.h>
  1440.     
  1441. amiga.lib/HotKey                                             amiga.lib/HotKey
  1442.  
  1443.    NAME
  1444.     HotKey -- create a commodity triad. (V36)
  1445.  
  1446.    SYNOPSIS
  1447.     filterObj = Hotkey(description,port,id);
  1448.  
  1449.     CxObj *HotKey(STRPTR,struct MsgPort *,LONG);
  1450.  
  1451.    FUNCTION
  1452.     This function creates a triad of commodity objects to accomplish a
  1453.     high-level function.
  1454.  
  1455.     The three objects are a filter, which is created to match by the call
  1456.     CxFilter(description), a sender created by the call CxSender(port,id),
  1457.     and a translator which is created by CxTranslate(NULL), so that it
  1458.     swallows any commodity input event messages that are passed down by
  1459.     the filter.
  1460.  
  1461.     This is the simple way to get a message sent to your program when the
  1462.     user performs a particular input action.
  1463.  
  1464.     It is strongly recommended that the ToolTypes environment be used to
  1465.     allow the user to specify the input descriptions for your application's
  1466.     hotkeys.
  1467.  
  1468.    INPUTS
  1469.     description - the description string to use for the filter in the same
  1470.               format as accepted by commodities.library/SetFilter()
  1471.     port - port for the sender to send messages to.
  1472.     id - id of the messages sent by the sender
  1473.  
  1474.    RESULTS
  1475.     filterObj - a pointer to a filter object, or NULL if it could
  1476.             not be created.
  1477.  
  1478.    SEE ALSO
  1479.     CxFilter(), CxSender(), CxTranslate(),
  1480.     commodities.library/CxObjError(), commodities.library/SetFilter()
  1481.  
  1482. amiga.lib/InvertString                                 amiga.lib/InvertString
  1483.  
  1484.    NAME
  1485.     InvertString -- produce input events that would generate the
  1486.             given string. (V36)
  1487.  
  1488.    SYNOPSIS
  1489.     events = InvertString(str,km)
  1490.  
  1491.     struct InputEvent *InvertString(STRPTR,struct KeyMap *);
  1492.  
  1493.    FUNCTION
  1494.     This function returns a linked list of input events which would
  1495.     translate into the string using the supplied keymap (or the system
  1496.     default keymap if 'km' is NULL).
  1497.  
  1498.     'str' is null-terminated and may contain:
  1499.        - ANSI character codes
  1500.        - backslash escaped characters:
  1501.         \n   -   CR
  1502.         \r   -   CR
  1503.         \t   -   TAB
  1504.         \0   -   illegal, do not use!
  1505.         \\   -   backslash
  1506.        - a text description of an input event as used by ParseIX(),
  1507.          enclosed in angle brackets.
  1508.  
  1509.     An example is:
  1510.           abc<alt f1>\nhi there.
  1511.  
  1512.    INPUTS
  1513.     str - null-terminated string to convert to input events
  1514.     km - keymap to use for the conversion, or NULL to use the default
  1515.          keymap.
  1516.  
  1517.    RESULTS
  1518.     events - a chain of input events, or NULL if there was a problem. The
  1519.          most likely cause of failure is an illegal description
  1520.          enclosed in angled brackets.
  1521.  
  1522.          This chain should eventually be freed using FreeIEvents().
  1523.  
  1524.    SEE ALSO
  1525.     commodities.library/ParseIX(), FreeIEvents()
  1526.  
  1527. amiga.lib/LibAllocPooled                             amiga.lib/LibAllocPooled
  1528.  
  1529.     NAME
  1530.     LibAllocPooled -- Allocate memory with the pool manager (V33)
  1531.  
  1532.     SYNOPSIS
  1533.     memory=LibAllocPooled(poolHeader,memSize)
  1534.     d0                    a0         d0
  1535.  
  1536.     void *LibAllocPooled(void *,ULONG);
  1537.  
  1538.     FUNCTION
  1539.     This function is a copy of the pool functions in V39 and up of
  1540.     EXEC.  In fact, if you are running in V39, this function will
  1541.     notice and call the EXEC function.  This function works in
  1542.     V33 and up (1.2) Amiga system.
  1543.  
  1544.     The C code interface is _LibAllocPooled() and takes its arguments
  1545.     from the stack just like the C code interface for AllocPooled()
  1546.     in amiga.lib.  The assembly code interface is with the symbol
  1547.     _AsmAllocPooled: and takes the parameters in registers with the
  1548.     additional parameter of ExecBase being in a6 which can be used
  1549.     from SAS/C 6 by a prototype of:
  1550.  
  1551.     void * __asm AsmAllocPooled(register __a0 void *,
  1552.                                 register __d0 ULONG,
  1553.                                 register __a6 struct ExecBase *);
  1554.  
  1555.     Allocate memSize bytes of memory, and return a pointer. NULL is
  1556.     returned if the allocation fails.
  1557.  
  1558.     Doing a LibDeletePool() on the pool will free all of the puddles
  1559.     and thus all of the allocations done with LibAllocPooled() in that
  1560.     pool.  (No need to LibFreePooled() each allocation)
  1561.  
  1562.     INPUTS
  1563.     memSize - the number of bytes to allocate
  1564.     poolHeader - a specific private pool header.
  1565.  
  1566.     RESULT
  1567.     A pointer to the memory, or NULL.
  1568.     The memory block returned is long word aligned.
  1569.  
  1570.     NOTES
  1571.     The pool function do not protect an individual pool from
  1572.     multiple accesses.  The reason is that in most cases the pools
  1573.     will be used by a single task.  If your pool is going to
  1574.     be used by more than one task you must Semaphore protect
  1575.     the pool from having more than one task trying to allocate
  1576.     within the same pool at the same time.  Warning:  Forbid()
  1577.     protection *will not work* in the future.  *Do NOT* assume
  1578.     that we will be able to make it work in the future.  LibAllocPooled()
  1579.     may well break a Forbid() and as such can only be protected
  1580.     by a semaphore.
  1581.  
  1582.     To track sizes yourself, the following code can be used:
  1583.     *Assumes a6=ExecBase*
  1584.  
  1585.     ;
  1586.     ; Function to do AllocVecPooled(Pool,memSize)
  1587.     ;
  1588.     AllocVecPooled:    addq.l    #4,d0        ; Get space for tracking
  1589.             move.l    d0,-(sp)    ; Save the size
  1590.             jsr    LibAllocPooled    ; Call pool...
  1591.             move.l    (sp)+,d1    ; Get size back...
  1592.             tst.l    d0        ; Check for error
  1593.             beq.s    avp_fail    ; If NULL, failed!
  1594.             move.l    d0,a0        ; Get pointer...
  1595.             move.l    d1,(a0)+    ; Store size
  1596.             move.l    a0,d0        ; Get result
  1597.     avp_fail:    rts            ; return
  1598.  
  1599.     ;
  1600.     ; Function to do LibFreeVecPooled(pool,memory)
  1601.     ;
  1602.     FreeVecPooled:    move.l    -(a1),d0    ; Get size / ajust pointer
  1603.             jmp    LibFreePooled
  1604.  
  1605.     SEE ALSO
  1606.     FreePooled(), CreatePool(), DeletePool(),
  1607.     LibFreePooled(), LibCreatePool(), LibDeletePool()
  1608.  
  1609. amiga.lib/LibCreatePool                               amiga.lib/LibCreatePool
  1610.  
  1611.     NAME
  1612.     LibCreatePool -- Generate a private memory pool header (V33)
  1613.  
  1614.     SYNOPSIS
  1615.     newPool=LibCreatePool(memFlags,puddleSize,threshSize)
  1616.     a0                    d0       d1         d2
  1617.  
  1618.     void *LibCreatePool(ULONG,ULONG,ULONG);
  1619.  
  1620.     FUNCTION
  1621.     This function is a copy of the pool functions in V39 and up of
  1622.     EXEC.  In fact, if you are running in V39, this function will
  1623.     notice and call the EXEC function.  This function works in
  1624.     V33 and up (1.2) Amiga system.
  1625.  
  1626.     The C code interface is _LibCreatePool() and takes its arguments
  1627.     from the stack just like the C code interface for CreatePool()
  1628.     in amiga.lib.  The assembly code interface is with the symbol
  1629.     _AsmCreatePool: and takes the parameters in registers with the
  1630.     additional parameter of ExecBase being in a6 which can be used
  1631.     from SAS/C 6 by a prototype of:
  1632.  
  1633.     void * __asm AsmCreatePool(register __d0 ULONG,
  1634.                                register __d1 ULONG,
  1635.                                register __d2 ULONG,
  1636.                                register __a6 struct ExecBase *);
  1637.  
  1638.     Allocate and prepare a new memory pool header.    Each pool is a
  1639.     separate tracking system for memory of a specific type.  Any number
  1640.     of pools may exist in the system.
  1641.  
  1642.     Pools automatically expand and shrink based on demand.    Fixed sized
  1643.     "puddles" are allocated by the pool manager when more total memory
  1644.     is needed.  Many small allocations can fit in a single puddle.
  1645.     Allocations larger than the threshSize are allocation in their own
  1646.     puddles.
  1647.  
  1648.     At any time individual allocations may be freed.  Or, the entire
  1649.     pool may be removed in a single step.
  1650.  
  1651.     INPUTS
  1652.     memFlags - a memory flags specifier, as taken by AllocMem.
  1653.     puddleSize - the size of Puddles...
  1654.     threshSize - the largest allocation that goes into normal puddles
  1655.                  This *MUST* be less than or equal to puddleSize
  1656.                  (LibCreatePool() will fail if it is not)
  1657.  
  1658.     RESULT
  1659.     The address of a new pool header, or NULL for error.
  1660.  
  1661.     SEE ALSO
  1662.     DeletePool(), AllocPooled(), FreePooled(), exec/memory.i,
  1663.     LibDeletePool(), LibAllocPooled(), LibFreePooled()
  1664.  
  1665. amiga.lib/LibDeletePool                               amiga.lib/LibDeletePool
  1666.  
  1667.     NAME
  1668.     LibDeletePool --  Drain an entire memory pool (V33)
  1669.  
  1670.     SYNOPSIS
  1671.     LibDeletePool(poolHeader)
  1672.                   a0
  1673.  
  1674.     void LibDeletePool(void *);
  1675.  
  1676.     FUNCTION
  1677.     This function is a copy of the pool functions in V39 and up of
  1678.     EXEC.  In fact, if you are running in V39, this function will
  1679.     notice and call the EXEC function.  This function works in
  1680.     V33 and up (1.2) Amiga system.
  1681.  
  1682.     The C code interface is _LibDeletePool() and takes its arguments
  1683.     from the stack just like the C code interface for DeletePool()
  1684.     in amiga.lib.  The assembly code interface is with the symbol
  1685.     _AsmDeletePool: and takes the parameters in registers with the
  1686.     additional parameter of ExecBase being in a6 which can be used
  1687.     from SAS/C 6 by a prototype of:
  1688.  
  1689.     void __asm AsmDeletePool(register __a0 void *,
  1690.                              register __a6 struct ExecBase *);
  1691.  
  1692.     Frees all memory in all puddles of the specified pool header, then
  1693.     deletes the pool header.  Individual free calls are not needed.
  1694.  
  1695.     INPUTS
  1696.     poolHeader - as returned by LibCreatePool().
  1697.  
  1698.     SEE ALSO
  1699.     CreatePool(), AllocPooled(), FreePooled(),
  1700.     LibCreatePool(), LibAllocPooled(), LibFreePooled()
  1701.  
  1702. amiga.lib/LibFreePooled                               amiga.lib/LibFreePooled
  1703.  
  1704.     NAME
  1705.     LibFreePooled -- Free pooled memory  (V33)
  1706.  
  1707.     SYNOPSIS
  1708.     LibFreePooled(poolHeader,memory,memSize)
  1709.               a0         a1     d0
  1710.  
  1711.     void LibFreePooled(void *,void *,ULONG);
  1712.  
  1713.     FUNCTION
  1714.     This function is a copy of the pool functions in V39 and up of
  1715.     EXEC.  In fact, if you are running in V39, this function will
  1716.     notice and call the EXEC function.  This function works in
  1717.     V33 and up (1.2) Amiga system.
  1718.  
  1719.     The C code interface is _LibFreePooled() and takes its arguments
  1720.     from the stack just like the C code interface for FreePooled()
  1721.     in amiga.lib.  The assembly code interface is with the symbol
  1722.     _AsmFreePooled: and takes the parameters in registers with the
  1723.     additional parameter of ExecBase being in a6 which can be used
  1724.     from SAS/C 6 by a prototype of:
  1725.  
  1726.     void __asm AsmFreePooled(register __a0 void *,
  1727.                              register __a1 void *,
  1728.                              register __d0 ULONG,
  1729.                              register __a6 struct ExecBase *);
  1730.  
  1731.     Deallocates memory allocated by LibAllocPooled().  The size of the
  1732.     allocation *MUST* match the size given to LibAllocPooled().
  1733.     The reason the pool functions do not track individual allocation
  1734.     sizes is because many of the uses of pools have small allocation
  1735.     sizes and the tracking of the size would be a large overhead.
  1736.  
  1737.     Only memory allocated by LibAllocPooled() may be freed with this
  1738.     function!
  1739.  
  1740.     Doing a LibDeletePool() on the pool will free all of the puddles
  1741.     and thus all of the allocations done with LibAllocPooled() in that
  1742.     pool.  (No need to LibFreePooled() each allocation)
  1743.  
  1744.     INPUTS
  1745.     memory - pointer to memory allocated by AllocPooled.
  1746.     poolHeader - a specific private pool header.
  1747.  
  1748.     NOTES
  1749.     The pool function do not protect an individual pool from
  1750.     multiple accesses.  The reason is that in most cases the pools
  1751.     will be used by a single task.  If your pool is going to
  1752.     be used by more than one task you must Semaphore protect
  1753.     the pool from having more than one task trying to allocate
  1754.     within the same pool at the same time.  Warning:  Forbid()
  1755.     protection *will not work* in the future.  *Do NOT* assume
  1756.     that we will be able to make it work in the future.  LibFreePooled()
  1757.     may well break a Forbid() and as such can only be protected
  1758.     by a semaphore.
  1759.  
  1760.     To track sizes yourself, the following code can be used:
  1761.     *Assumes a6=ExecBase*
  1762.  
  1763.     ;
  1764.     ; Function to do AllocVecPooled(Pool,memSize)
  1765.     ;
  1766.     AllocVecPooled:    addq.l    #4,d0        ; Get space for tracking
  1767.             move.l    d0,-(sp)    ; Save the size
  1768.             jsr    LibAllocPooled    ; Call pool...
  1769.             move.l    (sp)+,d1    ; Get size back...
  1770.             tst.l    d0        ; Check for error
  1771.             beq.s    avp_fail    ; If NULL, failed!
  1772.             move.l    d0,a0        ; Get pointer...
  1773.             move.l    d1,(a0)+    ; Store size
  1774.             move.l    a0,d0        ; Get result
  1775.     avp_fail:    rts            ; return
  1776.  
  1777.     ;
  1778.     ; Function to do LibFreeVecPooled(pool,memory)
  1779.     ;
  1780.     FreeVecPooled:    move.l    -(a1),d0    ; Get size / ajust pointer
  1781.             jmp    LibFreePooled
  1782.  
  1783.     SEE ALSO
  1784.     AllocPooled(), CreatePool(), DeletePool(),
  1785.     LibAllocPooled(), LibCreatePool(), LibDeletePool()
  1786.  
  1787. amiga.lib/NewList                                           amiga.lib/NewList
  1788.  
  1789.    NAME
  1790.     NewList -- prepare a list structure for use
  1791.  
  1792.    SYNOPSIS
  1793.     NewList(list)
  1794.  
  1795.     VOID NewList(struct List *);
  1796.     VOID NewList(struct MinList *);
  1797.  
  1798.    FUNCTION
  1799.     Perform the magic needed to prepare a List header structure for
  1800.     use; the list will be empty and ready to use.  (If the list is the
  1801.     full featured type, you may need to initialize lh_Type afterwards)
  1802.  
  1803.     Assembly programmers may want to use the NEWLIST macro instead.
  1804.  
  1805.    INPUTS
  1806.     list - pointer to a List or MinList.
  1807.  
  1808.    SEE ALSO
  1809.     <exec/lists.h>
  1810.  
  1811. amiga.lib/printf                                             amiga.lib/printf
  1812.  
  1813.    NAME
  1814.     printf - print a formatted output line to the standard output.
  1815.  
  1816.    SYNOPSIS
  1817.     printf(formatstring [,value [,values] ] );
  1818.  
  1819.    FUNCTION
  1820.     Format the output in accordance with specifications in the format
  1821.     string.
  1822.  
  1823.    INPUTS
  1824.     formatString - a C-language-like NULL-terminated format string,
  1825.                with the following supported % options:
  1826.  
  1827.       %[flags][width][.limit][length]type
  1828.  
  1829.         $     - must follow the arg_pos value, if specified
  1830.       flags   - only one allowed. '-' specifies left justification.
  1831.       width   - field width. If the first character is a '0', the
  1832.                 field is padded with leading 0s.
  1833.         .     - must precede the field width value, if specified
  1834.       limit   - maximum number of characters to output from a string.
  1835.                 (only valid for %s or %b).
  1836.       length  - size of input data defaults to word (16-bit) for types c,
  1837.             d, u and x, 'l' changes this to long (32-bit).
  1838.       type    - supported types are:
  1839.                       b - BSTR, data is 32-bit BPTR to byte count followed
  1840.                           by a byte string. A NULL BPTR is treated as an
  1841.                   empty string. (V36)
  1842.                       d - signed decimal
  1843.               u - unsigned decimal
  1844.                       x - hexadecimal with hex digits in uppercase
  1845.               X - hexadecimal with hex digits in lowercase
  1846.                       s - string, a 32-bit pointer to a NULL-terminated
  1847.                           byte string. A NULL pointer is treated
  1848.                           as an empty string.
  1849.                       c - character
  1850.  
  1851.     value(s) - numeric variables or addresses of null-terminated strings
  1852.                to be added to the format information.
  1853.  
  1854.    NOTE
  1855.     The global "_stdout" must be defined, and contain a pointer to
  1856.     a legal AmigaDOS file handle. Using the standard Amiga startup
  1857.     module sets this up. In other cases you will need to define
  1858.     stdout, and assign it to some reasonable value (like what the
  1859.     dos.library/Output() call returns). This code would set it up:
  1860.  
  1861.         ULONG stdout;
  1862.         stdout=Output();
  1863.  
  1864.    BUGS
  1865.     This function will crash if the resulting stream after
  1866.     parameter substitution is longer than 140 bytes.
  1867.  
  1868. amiga.lib/RangeRand                                       amiga.lib/RangeRand
  1869.  
  1870.    NAME
  1871.     RangeRand - generate a random number within a specific integer range
  1872.  
  1873.    SYNOPSIS
  1874.     number = RangeRand(maxValue);
  1875.  
  1876.     UWORD RangeRand(UWORD);
  1877.  
  1878.    FUNCTION
  1879.     RangeRand() accepts a value from 0 to 65535, and returns a value
  1880.     within that range.
  1881.  
  1882.     maxValue is passed on stack as a 32-bit integer but used as though
  1883.     it is only a 16-bit integer. Variable named RangeSeed is available
  1884.     beginning with V33 that contains the global seed value passed from
  1885.     call to call and thus can be changed in a program by declaring:
  1886.  
  1887.       extern ULONG RangeSeed;
  1888.  
  1889.    INPUTS
  1890.     maxValue - the returned random number will be in the range
  1891.                [0..maxValue-1]
  1892.  
  1893.    RESULT
  1894.     number - pseudo random number in the range of [0..maxValue-1].
  1895.  
  1896.    SEE ALSO
  1897.     FastRand()
  1898.  
  1899. amiga.lib/RemTOF                                             amiga.lib/RemTOF
  1900.  
  1901.    NAME
  1902.     RemTOF - remove a task from the VBlank interrupt server chain.
  1903.  
  1904.    SYNOPSIS
  1905.     RemTOF(i);
  1906.  
  1907.     VOID RemTOF(struct Isrvstr *);
  1908.  
  1909.    FUNCTION
  1910.     Removes a task from the vertical-blanking interval interrupt server
  1911.     chain.
  1912.  
  1913.    INPUTS
  1914.     i - pointer to an Isrvstr structure
  1915.  
  1916.    SEE ALSO
  1917.     AddTOF(), <graphics/graphint.h>
  1918.  
  1919. amiga.lib/SetRexxVar                                     amiga.lib/SetRexxVar
  1920.  
  1921.    NAME
  1922.     SetRexxVar - Sets the value of a variable of a running ARexx program
  1923.  
  1924.    SYNOPSIS
  1925.     error = SetRexxVar(message,varname,value,length)
  1926.     D0                 A0      A1      D0    D1
  1927.  
  1928.     LONG SetRexxVar(struct RexxMsg *,char *,char *,ULONG);
  1929.  
  1930.    FUNCTION
  1931.     This function will attempt to the the value of the symbol
  1932.     varname in the ARexx script that sent the message.
  1933.  
  1934.     While this function is new in the V37 amiga.lib, it is safe to
  1935.     call it in all versions of the operating system.  It is also
  1936.     PURE code, thus usable in resident/pure executables.
  1937.  
  1938.    NOTE
  1939.     This is a stub in amiga.lib.  It is only available via amiga.lib.
  1940.     The stub has two labels.  One, _SetRexxVar, takes the arguments
  1941.     from the stack.  The other, SetRexxVar, takes the arguments in
  1942.     registers.
  1943.  
  1944.     This routine does a CheckRexxMsg() on the message.
  1945.  
  1946.    EXAMPLE
  1947.  
  1948.     char    *value;
  1949.  
  1950.     /* Message is one from ARexx */
  1951.     if (!SetRexxVar(rxmsg,"TheVar","25 Dollars",10))
  1952.     {
  1953.         /* The value of TheVar will now be "25 Dollars" */
  1954.     }
  1955.  
  1956.    INPUTS
  1957.     message        A message gotten from an ARexx script
  1958.     varname        The name of the variable to set
  1959.     value        A string that will be the new value of the variable
  1960.     length        The length of the value string
  1961.  
  1962.  
  1963.    RESULTS
  1964.     error        0 for success, otherwise an error code.
  1965.             (Other codes may exists, these are documented)
  1966.             3  == Insufficient Storage
  1967.             9  == String too long
  1968.             10 == invalid message
  1969.  
  1970.    SEE ALSO
  1971.     SetRexxVar(), CheckRexxMsg()
  1972.  
  1973. amiga.lib/SetSuperAttrs                               amiga.lib/SetSuperAttrs
  1974.  
  1975.    NAME
  1976.     SetSuperAttrs -- Invoke OM_SET method on superclass with varargs.
  1977.  
  1978.    SYNOPSIS
  1979.     result = SetSuperAttrs( cl, obj, tag, ... )
  1980.  
  1981.     ULONG SetSuperAttrs( struct IClass *, Object *, ULONG, ... );
  1982.  
  1983.    FUNCTION
  1984.     Boopsi support function which invokes the OM_SET method on the
  1985.     superclass of the supplied class for the supplied object.  Allows
  1986.     the ops_AttrList to be supplied on the stack (i.e. in a varargs
  1987.     way).  The equivalent non-varargs function would simply be
  1988.  
  1989.         DoSuperMethod( cl, obj, OM_SET, taglist, NULL );
  1990.  
  1991.    INPUTS
  1992.     cl - pointer to boopsi class whose superclass is to
  1993.         receive the OM_SET message
  1994.     obj - pointer to boopsi object
  1995.     tag - list of tag-attribute pairs, ending in TAG_DONE
  1996.  
  1997.    RESULT
  1998.     result - class and message-specific result.
  1999.  
  2000.    NOTES
  2001.     This function first appears in the V37 release of amiga.lib.
  2002.     While it intrinsically does not require any particular release
  2003.     of the system software to operate, it is designed to work with
  2004.     the boopsi subsystem of Intuition, which was only introduced
  2005.     in V36.
  2006.  
  2007.    SEE ALSO
  2008.     CoerceMethodA(), DoMethodA(), DoSuperMethodA(), <intuition/classusr.h>
  2009.     ROM Kernel Manual boopsi section
  2010.  
  2011. amiga.lib/sprintf                                           amiga.lib/sprintf
  2012.  
  2013.    NAME
  2014.     sprintf - format a C-like string into a string buffer.
  2015.  
  2016.    SYNOPSIS
  2017.     sprintf(destination formatstring [,value [, values] ] );
  2018.  
  2019.    FUNCTION
  2020.     Performs string formatting identical to printf, but directs the output
  2021.     into a specific destination in memory. This uses the ROM version
  2022.     of printf (exec.library/RawDoFmt()), so it is very small.
  2023.  
  2024.     Assembly programmers can call this by placing values on the
  2025.     stack, followed by a pointer to the formatstring, followed
  2026.     by a pointer to the destination string.
  2027.  
  2028.    INPUTS
  2029.     destination - the address of an area in memory into which the
  2030.               formatted output is to be placed.
  2031.     formatstring - pointer to a null terminated string describing the
  2032.                    desired output formatting (see printf() for a
  2033.                description of this string).
  2034.     value(s) - numeric information to be formatted into the output
  2035.            stream.
  2036.  
  2037.    SEE ALSO
  2038.      printf(), exec.library/RawDoFmt()
  2039.  
  2040. amiga.lib/stdio                                               amiga.lib/stdio
  2041.  
  2042.    NAMES
  2043.     fclose    - close a file
  2044.     fgetc    - get a character from a file
  2045.     fprintf    - format data to file (see printf())
  2046.     fputc    - put character to file
  2047.     fputs    - write string to file
  2048.     getchar    - get a character from stdin
  2049.     printf    - put format data to stdout (see exec.library/RawDoFmt)
  2050.     putchar    - put character to stdout
  2051.     puts    - put string to stdout, followed by newline
  2052.  
  2053.    FUNCTION
  2054.     These functions work much like the standard C functions of the same
  2055.     names. The file I/O functions all use non-buffered AmigaDOS
  2056.     files, and must not be mixed with the file I/O of any C
  2057.     compiler. The names of these functions match those found in many
  2058.     standard C libraries, when a name conflict occurs, the function is
  2059.     generally taken from the FIRST library that was specified on the
  2060.     linker's command line.  Thus to use these functions, specify
  2061.     the amiga.lib library first.
  2062.  
  2063.     To get a suitable AmigaDOS FileHandle, the dos.library/Open() or
  2064.     dos.library/Output() functions must be used.
  2065.  
  2066.     All of the functions that write to stdout expect an appropriate
  2067.     FileHandle to have been set up ahead of time. Depending on
  2068.     your C compiler and options, this may have been done by the
  2069.     startup code.  Or it can be done manually
  2070.  
  2071.     From C:
  2072.         extern ULONG stdout;
  2073.         /* Remove the extern if startup code did not define stdout */
  2074.         stdout=Output();
  2075.  
  2076.     From assembly:
  2077.         XDEF    _stdout
  2078.         DC.L    _stdout    ;<- Place result of dos.library/Output() here.
  2079.  
  2080. amiga.lib/TimeDelay                                       amiga.lib/TimeDelay
  2081.  
  2082.    NAME
  2083.     TimeDelay -- Return after a period of time has elapsed.
  2084.  
  2085.    SYNOPSIS
  2086.     Error = TimeDelay( Unit, Seconds, MicroSeconds )
  2087.     D0                 D0    D1       D2
  2088.  
  2089.     LONG TimeDelay( LONG, ULONG, ULONG );
  2090.  
  2091.    FUNCTION
  2092.     Waits for the period of time specified before returning to the
  2093.     the caller.
  2094.  
  2095.    INPUTS
  2096.     Unit -- timer.device unit to open for this command.
  2097.     Seconds -- The seconds field of a timerequest is filled with
  2098.         this value. Check the documentation for what a particular
  2099.         timer.device unit expects there.
  2100.     MicroSeconds -- The microseconds field of a timerequest is
  2101.         filled with this value. Check the documentation for what
  2102.         a particular timer.device units expects there.
  2103.  
  2104.    RESULTS
  2105.     Error -- will be zero if all went well; otherwise, non-zero.
  2106.  
  2107.    NOTES
  2108.     Two likely reasons for failures are invalid unit numbers or
  2109.     no more free signal bits for this task.
  2110.  
  2111.     While this function first appears in V37 amiga.lib, it works
  2112.     on Kickstart V33 and higher.
  2113.  
  2114.    SEE ALSO
  2115.     timer.device/TR_ADDREQUEST,
  2116.     timer.device/TR_WAITUNTIL,
  2117.     timer.device/WaitUnitl()
  2118.  
  2119.    BUGS
  2120.  
  2121.